// 首页
// http://wap.shouji1234.cn/

// 登录
// http://wap.shouji1234.cn/Wap/Account/Login

// 接单
// http://wap.shouji1234.cn/Api/TaskMoney/GetMyTaskList

// 首页
let token = Android.getMap("token")
document.cookie = token



function getParameterHandler() {
    let headers = {
        "cookie": parameter.getMap("token")
    }
    let body = {}
    let strUrl = `?page=1&limit=10&state=1&platformId=0`
    let url = parameter.getMap("url") + strUrl
    return {
        mediaType: "json",
        requestType: "GET",
        url: url,
        headers: JSON.stringify(headers),
        body: JSON.stringify(body)
    }
}
getParameterHandler()



function getResponse() {
    let res = response.getMap("res")
    let code = "500"
    let message = "接单中"
    let dataKey = ""
    let dataValue = ""

    try {
        res = JSON.parse(res)
        if (res["code"] == 0 && res["count"] > 0) {
            code = "200"
            message = "接单成功，请尽快完成"
        } else {
            code = "500"
            message = "接单中"
        }
    } catch (e) {
        code = "300"
        message = "登录失败"
    }


    return {
        code: code,
        message: message,
        dataKey: dataKey,
        dataValue: dataValue
    }
}
getResponse()


